#include <iostream>
#include <algorithm>
#include <functional>

using std::cout;
using std::endl;
using std::begin;
using std::end;
using std::for_each;
using std::bind;
using std::placeholders::_1;

void PrintBigger(const int a, int num)
{
    if (a > num) {
        cout << a << endl;
    }
}

int main()
{
    int array[]{1, 2, 3, 4, 5};
    int num = 3;

    for_each(begin(array), end(array), bind(PrintBigger, _1, num));

    return 0;
}
